define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'scheme.show/index',
        add_url: 'scheme.show/add',
        edit_url: 'scheme.show/edit',
        delete_url: 'scheme.show/delete',
        export_url: 'scheme.show/export',
        modify_url: 'scheme.show/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id',search:false},
                    {field: 'name', title: '方案名称'},
                    {field: 'fields', title: '列表展示',search:false},
                    {field: 'type', title: '类型',selectList: {1: '商机', 2: '订单',3:'设计师',4:'异业'}}, //1 商机 2 订单 3 设计师 4 异业
                    // {field: 'status', title: '启用',selectList: {0: '否', 1: '是'}, templet: ea.table.switch},
                    {field: 'create_time', title: '创建时间',search: 'range'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});